﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AlgorithmCenter
{
    public class AlgorithmCenter200819
    {
        /// <summary>
        /// 查找唯一的重复数据
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public int FindRepeatNum(int[] array)
        {
            int res = 0;
            foreach (int x in array)
            {
                res ^= x;
            }
            for (int i = 1; i <= array.Length - 1; i++)
            {
                res ^= i;
            }
            return res;
        }
    }
}
